<?php
/**
 * Created By PhpStorm.
 * User: RenJianHong
 * Date: 2021-08-03 14:32
 */

namespace Modules\Order\Entities;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\Schema;

class Order extends BaseModel
{
    protected $table = "order";
    protected $guarded = [];

    /**
     * 设置订单状态数组值
     * @return string[]
     */
    public static function getOrderStatusArr()
    {
        return [
            0 => "待支付",
            1 => "待发货",
            2 => "已发货",
            3 => "已完成",
            4 => "已取消",
            5 => "回收站",
        ];
    }
    
    /**
     * 订单状态
     */
    public function getOrderStatus($order_status)
    {
        if($order_status == 0){
            return '待支付';
        }if($order_status == 1){
            return '待发货';
        }if($order_status == 2){
            return '已发货';
        }if($order_status == 3){
            return '已完成';
        }if($order_status == 4){
            return '已取消';
        }if($order_status == 5){
            return '待评价';
        }if($order_status == 6){
            return '已评价';
        }if($order_status == 7){
            return '已申请售后';
        }if($order_status == 8){
            return '售后完成';
        }else{
            return '其他';
        }
    }
}